<?php

namespace app\common\model;

use app\admin\model\Admin;
use think\Model;

class HrCode extends Model
{
    // 表名
    protected $name = 'hongruan_code';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    // 定义时间戳字段名
    protected $createTime = 'created_at';
    protected $updateTime = false;

    const NOT_ACTIVATE = 0;
    const ACTIVATE = 1;

    public function school()
    {
        return $this->belongsTo(School::class)->field('id,name');
    }

    public function admin()
    {
        return $this->belongsTo(Admin::class)->field('id,username,nickname');
    }

}
